package inventory.service;

import inventory.entity.Equipment;
import inventory.entity.InRepositoryRecord;
import com.baomidou.mybatisplus.service.IService;
import inventory.entity.MaterialStuff;
import inventory.entity.Terminal;
import inventory.entity.bo.MaterialBo;
import inventory.entity.po.InRepositoryRecordPo;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author sxt
 * @since 2019-11-06
 */
public interface InRepositoryRecordService extends IService<InRepositoryRecord> {


    /**
     * 查询所有出入库记录
     * @return
     */
    List<InRepositoryRecordPo> queryAllInRepositoryRecordPo(String roleId);


    /**
     * 通过条件查询出入库记录
     * @return
     */
    List<InRepositoryRecordPo> queryInRepositoryRecordPoByCondition(Map<String, Object> columnMap);

    /**
     * 入库终端
     */
    boolean addTerminal(Terminal material, InRepositoryRecord inRepositoryRecord);

    /**
     * 入库设备
     */
    boolean addEquipment(Equipment equipment, InRepositoryRecord inRepositoryRecord);

    /**
     * 入库物件
     */
    boolean addStuff(MaterialStuff materialStuff, InRepositoryRecord inRepositoryRecord);

    /**
     * 根据入库时间段查询出入库记录
     * @param startTime
     * @param endTime
     * @return
     */
    List<InRepositoryRecordPo> queryInRepositoryByTimePeriod(Date startTime, Date endTime);

    /**
     * 终端出库
     * @author ttxxi
     * @param materialBo
     * @param imeis
     * @param inRepositoryRecord
     * @return
     */
    boolean outTerminal(MaterialBo materialBo, InRepositoryRecord inRepositoryRecord , List<String> imeis);

    /**
     * 设备出库
     * @param materialBo
     * @param inRepositoryRecord
     * @param imeis
     */
    boolean outEquipment(MaterialBo materialBo, InRepositoryRecord inRepositoryRecord, List<String> imeis);

    /**
     * 物料出库
     * @param materialBo
     * @param inRepositoryRecord
     */
    @Deprecated
    boolean outMaterialStuff(MaterialBo materialBo, InRepositoryRecord inRepositoryRecord);

    /**
     * 物料出库
     * @param map 键：material_stuff表的id  值：要出库的数量
     * @param inRepositoryRecord
     * @param materialBo
     * @return
     */
    boolean outMaterialStuff(Map<String,Object> map,MaterialBo materialBo,InRepositoryRecord inRepositoryRecord);
}
